<?php
	$setDate = !empty($_REQUEST['setDate']) ? $_REQUEST['setDate'] : date('Y-m-d', time()); 
	$linenum = isset($_REQUEST['linenum']) ? $_REQUEST['linenum'] : '10';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">

	<title>운세의신</title>
	
	<link rel="stylesheet" type="text/css" href="/css/common.css">
	<link rel="stylesheet" type="text/css" href="/css/sub.css">
	<link rel="stylesheet" type="text/css" href="/css/free.css">

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			
			// 메뉴 링크 설정
			$(".zodiac .sign ul li a").each(function(index) {
				$(this).click(function() {
					$(".conts .zbox").hide();
					var linename = $(this).text();
					$(".conts .zbox .title dl dt").each(function(index) {
						if (linename == $(this).text()) {
							$(".conts .zbox").eq(index).show();
						}
					});
				});
			});
			
			// 기본적으로 성격 탭을 보여준다. 
			$(".conts .zbox").hide();
			$(".conts .zbox").eq($("#linenum").val()).show();
			
			$(".year tbody tr:last th").addClass('end');
			$(".year tbody tr:last td").addClass('end');
		});
	</script>

</head>
<body>
<input type="hidden" id="linenum" value="<?=$linenum?>" />
<div id="wrap">
	<!-- Header -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/main_header.php'; ?>
	<!--// Header -->
	
	<!--커튼 데코레이션-->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/drape.php'; ?>
	<!--//커튼 데코레이션-->
	
	<!--컨텐츠-->
	<div id="content">
		<!--나의 정보 /배너/실시간 운세차트-->
		<div class="keybox">
			<!--나의정보-->
			<?php echo $INC_MEMBER; ?>
			<!--//나의정보-->
			
			<!--키배너-->
			<div class="key_bn"><span><img src="/images/sub/free/key_v1.jpg" /></span></div>
			<!--//키배너-->
			
			<!--실시간 운세차트-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/unse_chart.php'; ?>
			<!--//실시간운세차트-->
		</div>
		<!--나의 정보 /배너/실시간 운세차트-->

		<!--왼쪽 컨텐츠-->
		<div class="assistant">
			<!--왼쪽 메뉴-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/inc_lnb.php'; ?>
			<!--// 왼쪽 메뉴-->
			
			<!--추천테마-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/theme.php'; ?>
			<!--//추천테마-->
			
			<!--회원배너-->
			<div class="bn_member">
				<a href="/member/join"><img src="/images/sub/common/bn_member.png" /></a>
			</div>
			<!--회원배너-->
		</div>
		<!--//왼쪽 컨텐츠-->

		<!-- 메인컨텐츠-->
		<a name="pp"></a>
		<div class="cont">
			<div class="zodiac">
				<h3 class="freetit"><img src="/images/free/todayline_banner.png" alt="오늘의 띠별 운세" /></h3>
				<div class="box">
					<div class="sign blind">
						<ul>
							<li><a href="javascript:;" class="sign01">쥐띠</a></li>
							<li><a href="javascript:;" class="sign02">소띠</a></li>
							<li><a href="javascript:;" class="sign03">범띠</a></li>
							<li><a href="javascript:;" class="sign04">토끼띠</a></li>
							<li><a href="javascript:;" class="sign05">용띠</a></li>
							<li><a href="javascript:;" class="sign06">뱀띠</a></li>
							<li><a href="javascript:;" class="sign07">말띠</a></li>
							<li><a href="javascript:;" class="sign08">양띠</a></li>
							<li><a href="javascript:;" class="sign09">원숭이띠</a></li>
							<li><a href="javascript:;" class="sign10">닭띠</a></li>
							<li><a href="javascript:;" class="sign11">개띠</a></li>
							<li><a href="javascript:;" class="sign12">돼지띠</a></li>
						</ul>
					</div><!--sign-->
					
					<div class="todaydate">
						<p class="year">
							<img src="/images/common/day/day_<?=substr($setDate, 0,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_<?=substr($setDate, 1,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_<?=substr($setDate, 2,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_<?=substr($setDate, 3,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_dot.png" alt="점" />
						</p>
						<p>
							<img src="/images/common/day/day_<?=substr($setDate, 5,1)?>.png" alt="월" />
							<img src="/images/common/day/day_<?=substr($setDate, 6,1)?>.png" alt="월" />
							<img src="/images/common/day/day_dot.png" alt="점" />
						</p>
						<p>
							<img src="/images/common/day/day_<?=substr($setDate, 8,1)?>.png" alt="일" />
							<img src="/images/common/day/day_<?=substr($setDate, 9,1)?>.png" alt="일" />
						</p>
					</div><!--date-->
					
					<div class="conts">
<?	foreach ($contents['F022'] as $item) : ?>
<?
		$arr_tmp = explode(":", $item['db_data2']);
		$data[0]['title'] = trim($arr_tmp[0]);
		$data[0]['content'] = trim($arr_tmp[1]);
		$arr_tmp = explode(":", $item['db_data3']);
		$data[1]['title'] = trim($arr_tmp[0]);
		$data[1]['content'] = trim($arr_tmp[1]);
		$arr_tmp = explode(":", $item['db_data4']);
		$data[2]['title'] = trim($arr_tmp[0]);
		$data[2]['content'] = trim($arr_tmp[1]);
		if (!empty($item['db_data5'])) {
			$arr_tmp = explode(":", $item['db_data5']);
			$data[3]['title'] = trim($arr_tmp[0]);
			$data[3]['content'] = trim($arr_tmp[1]);
		}
?>
						<div class="zbox">
							<div class="title">
								<dl>
									<dt><?=$item['line_name']?></dt>
									<dd><?=$item['db_data1']?></dd>
								</dl>
							</div><!--title-->
							<div class="year">
								 <table width="100%" summary="띠 년도별운세" cellpadding="0" cellspacing="0">
									<caption class="blind"> 년도운세</caption>
									<colgroup>
										<col width="10%" />
										<col width="*" />
									</colgroup>
									<tbody>
<?		foreach ($data as $cont) : ?>
										<tr>
											<th scope="row"><?=$cont['title']?></th>
											<td><?=$cont['content']?></td>
										</tr>
<?		endforeach ?>
									</tbody>
								 </table>
							</div><!--year-->
						</div><!--zbox-->
<?	endforeach ?>
					</div><!--conts-->
				</div><!--box-->
			</div><!--zodiac-->
			<div class="assistant3"> 
				<!--함께보면좋은 운세-->
				<div class="left">
					<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/together.php'; ?>
				</div>
				<!--//함께보면좋은 운세--> 
				<!--후기게시판-->
				<div class="right">
					<?php echo $INC_POSTSCRIPT_LIST ?>
				</div>
				<!--//후기게시판--> 
			</div>
			<!--//하단컨텐츠-->  
		</div>	
		<!--// Contents -->
		<!--서비스배너-->
		<div class="s_bn"><a href="/product/package"><img src="/images/main/bn_service.png" /></a></div>
		<!--//서비스배너--> 
	</div>
	<!--// 메인컨텐츠-->

	<!-- Footer -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/main_footer.php'; ?>
	<!--// Footer -->
   
</div>
</body>
</html>